package com.chw.mapp;

import com.chw.model.Key;
import com.chw.model.Type;
import com.chw.model.Value;
import com.chw.model.vo.KeyVo;
import com.chw.model.vo.UserVo;
import com.chw.model.vo.ValueVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
public interface TypeMapp {
    @Select("select * from commodity_type")
    List<Type> queryType();

    void addType(Type type);

    void updateType(Type type);

    void deleteType(@Param("id") Integer id, @Param("isDel") Integer isDel);

    List<KeyVo> queryKey(UserVo userVo);

    Long count(UserVo userVo);

    void updateKey(Key key);

    void addKey(Key key);
    @Select("select * from commodity_key where tid=#{id}")
    List<ValueVo> queryData(Integer id);
    @Select("select * from commodity_value where aid=#{id}")
    List<Value> queryValueDate(Integer id);
}
